package fun.qu_an.minecraft.fabric.fzbbl.event;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.scoreboard.ScoreboardObjective;

public class ScoreboardEvents {
	public static final Event<ScoreboardAdded> ADDED = EventFactory.createArrayBacked(ScoreboardAdded.class,
		listeners -> objective -> {
			for (ScoreboardAdded listener : listeners) {
				listener.interact(objective);
			}
		});

	public static final Event<ScoreboardRemoved> REMOVED = EventFactory.createArrayBacked(ScoreboardRemoved.class,
		(listeners) -> (objective) -> {
			for (ScoreboardRemoved listener : listeners) {
				listener.interact(objective);
			}
		});

	@FunctionalInterface
	public interface ScoreboardAdded {
		void interact(ScoreboardObjective objective);
	}

	@FunctionalInterface
	public interface ScoreboardRemoved {
		void interact(ScoreboardObjective objective);
	}
}
